bin_PROGRAMS=qd
qd_SOURCES=qdf.f90 getopt_f.c gslwrappers.c system.h string_f.h

EXTRA_DIST=missing.f90

#  uncomment the following if qd requires the math library
#  #qd_LDADD=-lm

LDADD = libqdf.a @LIBS_FFT@ @LIBS_BLAS@ @LIBS_LAPACK@ @GSL_LIBS@ @FCLIBS@ 

noinst_LIBRARIES = libqdf.a

libqdf_a_SOURCES = \
    command_line.F90        \
    coeff.f90               \
    states.f90              \
    mesh.f90                \
    mesh_init.f90           \
    fftw3.f90               \
    cf.f90                  \
    poisson.f90             \
    vxc.f90                 \
    epot.f90                \
    ipot.f90                \
    output.f90              \
    energy.f90              \
    hpsi.f90 rho.f90        \
    write_wfs.f90           \
    read_wfs.f90            \
    init_wfs.f90            \
    cg.f90                  \
    scf.f90                 \
    gs.f90                  \
    perturbation.f90        \
    exponential.f90         \
    propagator.f90          \
    propagate.f90           \
    td.f90                  \
    test_hartree.f90        \
    test_laplacian.f90      \
    test_exp.f90            \
    expokit.f90             \
    excitations.f90         \
    sf.f90


# how to compile a F90 file :)
## With preprocessor...
.F90.o:
	@FCCPP@ @CPPFLAGS@ $(AM_CPPFLAGS) -I. $< > $*_oct.f90
	@FC@ @FCFLAGS@  -c @FCFLAGS_f90@ -o $@ $*_oct.f90
## Without preprocessor.
.f90.o:
	@FC@ @FCFLAGS@ -c @FCFLAGS_f90@ -o $@ $<

config_F90.h: $(top_builddir)/config.h
	grep '^#define' $^ > config_F90.h

# cleaning
CLEANFILES = *~ *.bak *.mod *.il *.d *.pc* ifc* config_F90.h
DISTCLEANFILES = Makefile.in dirs.h


# Dependencies
command_line.o: command_line.F90 config_F90.h
cf.o : cf.f90 fftw3.o
cg.o : cg.f90 mesh.o
coeff.o : coeff.f90
energy.o : energy.f90 mesh.o states.o
epot.o : epot.f90 mesh.o
excitations.o : excitations.f90 poisson.o fftw3.o mesh.o states.o
expokit.o : expokit.f90
exponential.o : exponential.f90 mesh.o
fftw3.o : fftw3.f90
gs.o : gs.f90 fftw3.o mesh.o poisson.o states.o
hpsi.o : hpsi.f90 mesh.o
init_wfs.o : init_wfs.f90 mesh.o states.o
ipot.o : ipot.f90 poisson.o mesh.o
mesh.o : mesh.f90 mesh_init.o
mesh_init.o : mesh_init.f90
output.o : output.f90 mesh.o
perturbation.o : perturbation.f90 mesh.o
poisson.o : poisson.f90 cf.o mesh.o
propagate.o : propagate.f90 mesh.o states.o
propagator.o : propagator.f90 exponential.o mesh.o states.o
qdf.o : qdf.f90
read_wfs.o : read_wfs.f90 mesh.o states.o
rho.o : rho.f90 mesh.o states.o
scf.o : scf.f90 mesh.o states.o
sf.o : sf.f90
states.o : states.f90
td.o : td.f90 poisson.o fftw3.o mesh.o states.o
test_hartree.o : test_hartree.f90 poisson.o fftw3.o mesh.o
test_laplacian.o : test_laplacian.f90 mesh_init.o mesh.o
vxc.o : vxc.f90 mesh.o
write_wfs.o : write_wfs.f90 mesh.o states.o
